import requests


class Cinema:
    def __init__(self):
        self.session = requests.Session()

        url = "http://api.51tickets.com/login"
        bady = {"username": "s001", "password": "123456", "code": "1357", "uuid": "18e7f39d1a234baaa62a12968f5c38f6"}
        res = self.session.post(url=url,json=bady)
        # print(res.json())
        token = res.json()["token"]
        headers = {"Authorization": "Bearer "+ token}
        self.session.headers.update(headers)

    def search_cinema_id(self,id):
        url= "http://api.51tickets.com/system/cinema/"+ str(id)
        res = self.session.get(url)
        # print(res.json())
        return res.json()








if __name__ == '__main__':
    C1=Cinema()
    result=C1.search_cinema_id(17)
    print(result)